﻿function $(i){
    if (i == _id) return _l;
    _l = document.getElementById(i);
    return _l;
}
function $S(i){return $(i).style; }
function s(h) {ct.appendChild(c(h));}
function e(i) {var el = $(i); if(el) el.parentNode.removeChild(el);}
function l(i) {
    if (i == 0) { ct = document.body;return;}
    var find = $(i);
	if(find == null){ s("<div id='"+i+"'></div>"); l(i); }
	else{ ct = find; }
}
function p(i,x,y,w,h){
    var c = $(i+''); 
    c.style.position='absolute';
    c.style.top=px(x);
    c.style.left=px(y);
    c.style.width=px(w);
    c.style.height=px(h);
}
function sc(i,a){$(i).setAttribute((document.all ? 'className' : 'class'), a);}
function px(v){return v+'px';}
function u(s) { try{eval(s);}catch(ex){alert(ex);} }
function c(h) {
    var f = document.createDocumentFragment(),
        t = document.createElement('div');
    t.innerHTML = h;
    while (t.firstChild) {f.appendChild(t.firstChild);}
    return f;
}
function a(h) {
    for(var c in h){
        if(false){}
        else if(h[c][0] == '+') s(h[c][1]);
        else if(h[c][0] == '-') e(h[c][1]);
        else if(h[c][0] == '*') l(h[c][1]);
        else u(h[c][1]);
    }
}
function vw() {
    var de = document.documentElement;
    if (typeof window.innerWidth != 'undefined') {
        ww = window.innerWidth, wh = window.innerHeight }
    else if (typeof de != 'undefined' && typeof de.clientWidth != 'undefined' && de.clientWidth != 0) {
        ww = de.clientWidth, wh = de.clientHeight }
    else {
        ww = document.getElementsByTagName('body')[0].clientWidth,
        wh = document.getElementsByTagName('body')[0].clientHeight
    }
}
function b(url) {
    document.clear(); vw();
    var html = w.show(url, ww, wh, document.cookie);
    a(html);
}
